<?php

	class User_model extends CI_Model {

		protected $__tbname = 'user';
		protected $__dbconf = 'default';

		var $id;	//bigint(20) unsigned	Primary Key	Auto Increment	NOT NULL
		var $username;	//varchar(25)			NOT NULL
		var $password;	//varchar(32)			NOT NULL
		var $email;	//varchar(100)	Unique Key		NOT NULL
		var $created_date;	//datetime			NOT NULL
		var $modified_date;	//datetime			NULL
		var $access_token;	//varchar(64)			NOT NULL
		var $last_login;	//datetime			NULL
		var $name;	//varchar(100)			NOT NULL
		var $is_deleted = 0;	//tinyint(1) unsigned			NOT NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'bigint', 'null' => FALSE, 'auto_increment' => TRUE),
			'username' => array('key' => 'MUL', 'type' => 'varchar', 'size' => 25, 'null' => FALSE),
			'password' => array('type' => 'varchar', 'size' => 32, 'null' => FALSE),
			'email' => array('key' => 'UNI', 'type' => 'varchar', 'size' => 100, 'null' => FALSE),
			'created_date' => array('type' => 'datetime', 'null' => FALSE),
			'modified_date' => array('type' => 'datetime', 'null' => TRUE),
			'access_token' => array('type' => 'varchar', 'size' => 64, 'null' => FALSE),
			'last_login' => array('type' => 'datetime', 'null' => TRUE),
			'name' => array('type' => 'varchar', 'size' => 100, 'null' => FALSE),
			'is_deleted' => array('type' => 'tinyint', 'null' => FALSE)
		);
	}
